package model

import (
	"gorm.io/gorm"
	"time"
)

type Order struct {
	Id        uint64         `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	UserId    uint64         `gorm:"column:user_id;type:bigint(20) UNSIGNED;comment:用户编号;not null;" json:"user_id"`            // 用户编号
	OrderSn   string         `gorm:"column:order_sn;type:varchar(50);comment:订单编号;not null;" json:"order_sn"`                  // 订单编号
	Amount    uint64         `gorm:"column:amount;type:bigint(20) UNSIGNED;comment:总金额;not null;" json:"amount"`               // 总金额
	DoctorId  uint64         `gorm:"column:doctor_id;type:bigint(20) UNSIGNED;comment:医生编号;not null;" json:"doctor_id"`        // 医生编号
	Payment   uint64         `gorm:"column:payment;type:bigint(3) UNSIGNED;comment:支付方式1:余额支付2:在线支付;not null;" json:"payment"` // 支付方式1:余额支付2:在线支付
	Status    uint64         `gorm:"column:status;type:bigint(3) UNSIGNED;comment:支付状态1:未支付2:已支付;not null;" json:"status"`     // 支付状态1:未支付2:已支付
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (o *Order) TableName() string {
	return "order"
}
